//package com.cn.filter;
//
//import com.cn.controller.interceptor.ProjectInterceptor;
//import com.cn.controller.interceptor.ProjectInterceptor2;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
//import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
//
//@Configuration
//public class SpringMvcSupport extends WebMvcConfigurationSupport {
//    @Autowired
//    private ProjectInterceptor projectInterceptor;
//
//    @Autowired
//    private ProjectInterceptor2 projectInterceptor2;
//
//    //让css,js等资源能够被访问到
//    @Override
//    protected void addResourceHandlers(ResourceHandlerRegistry registry) {
//        registry.addResourceHandler("/pages/**")
//                .addResourceLocations("/pages/");
//    }
//
//    //配置拦截器
//    @Override
//    protected void addInterceptors(InterceptorRegistry registry) {
//        //配置拦截器
//        registry.addInterceptor(projectInterceptor).addPathPatterns("/books","/books/*");
//        registry.addInterceptor(projectInterceptor2).addPathPatterns("/books","/books/*");
//    }
//}
